import React from "react";
import { Button, Drawer, Space } from "antd";
const BasicDrawer: React.FC<any> = (props: any) => {
  const {
    okText = "保存",
    cancelText = "取消",
    onSubmit,
    onClose,
    width = 520,
    placement = "right",
    maskClosable = true,
    disabled = false,
    ...args
  } = props;
  const extra = (
    <Space>
      <Button onClick={onClose}>{cancelText}</Button>
      <Button type="primary" onClick={onSubmit} disabled={disabled}>
        {okText}
      </Button>
    </Space>
  );
  const $props = { width, placement, extra, onClose, maskClosable, ...args };
  return <Drawer {...$props} />;
};
export default BasicDrawer;
